package com.hz.erp.enums.commons;

/**
 * @author 柯鑫
 * @ClassName com.hz.erp.enums.commons.ManagementFlagEnum
 * @description 管理员枚举类
 * @create 2020年06月05日 9:56
 */
public enum ManagementFlagEnum {

    NOT_MANAGEMENT("1", "非管理员"),
    IS_MANAGEMENT("2", "管理员"),
    SUPER_MANAGEMENT("3", "超级管理员");

    private String code;
    private String desc;

    ManagementFlagEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static String setCodeGetDesc(String code){
        for(ManagementFlagEnum value : ManagementFlagEnum.values() ){
            if(value.getCode().equals(code)){
                return value.getDesc();
            }
        }

        return null;
    }

    public static String setDescGetCode(String desc){
        for(ManagementFlagEnum value : ManagementFlagEnum.values()){
            if(value.getDesc().equals(desc)){
                return value.getCode();
            }
        }
        return null;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
